# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html


# 管道：数据清洗，去重
# 持久化：写txt，csv。写入数据库

class MovieSpiderPipeline(object):
    def process_item(self, item, spider):
        return item


class MoviePipline(object):
    def process_item(self, item, spider):
        with open('my_meiju.txt', 'a', encoding='utf-8') as f:
            f.writelines([item['movie_name'], item['movie_type'], item['movie_tv'], item['lasted_time'] + '\n'])
        return item
